/* Orbas:
 *     A open source CORBA Specification implementation from Huihoo.
 *
 * Copyright 2002-2003 Huihoo.org, Inc. All Right Reserved.
 *
 * This software is licensed under LGPL license.
 * See terms of license at gnu.org.
 *
 * For more information, visit:
 *
 * http://www.huihoo.org/orbas
 */



package org.huihoo.orbas.orb;

/**
 * An ORB class that is meant to be used as a singleton.  It contains limited
 * functionality of the ORB such as providing CORBA types without initializing
 * a server side component.  This is the class that can be returned by a call
 * to ORB.init().
 * 
 * <p>Copyright (c) 2002,2003</p>
 * <p>Company: <a href="http://www.huihoo.org/">huihoo.org</a></p>
 * @author <a href="http://www.huihoo.org/~mep">mep(mep@huihoo.com)</a>
 * @see <a href="http://www.huihoo.org/orbas">http://www.huihoo.org/orbas</a>
 * @version 1.0
 */


import org.huihoo.orbas.orb.typecode.TypeCodeFactory;
import org.omg.CORBA.Any;
import org.omg.CORBA.Request;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.TCKind;
import org.omg.CORBA.StructMember;
import org.omg.CORBA.UnionMember;
import org.omg.CORBA.ValueMember;
import org.omg.CORBA.NVList;
import org.omg.CORBA.NamedValue;
import org.omg.CORBA.ExceptionList;
import org.omg.CORBA.ContextList;
import org.omg.CORBA.Context;
import org.omg.CORBA.Environment;
import org.omg.CORBA.WrongTransaction;

public class ORBSingleton extends org.omg.CORBA_2_5.ORB {
    
    public ORBSingleton() { }

    public String[] list_initial_services() {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public org.omg.CORBA.Object resolve_initial_references(String object_name) throws org.omg.CORBA.ORBPackage.InvalidName {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public void run() {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public void connect(org.omg.CORBA.Object obj) {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public void disconnect(org.omg.CORBA.Object obj) {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public org.omg.CORBA.portable.OutputStream create_output_stream() {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public String object_to_string(org.omg.CORBA.Object obj) {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public org.omg.CORBA.Object string_to_object(String str) {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    protected void set_parameters(com.cognition.util.j2me.Properties props) {
        throw new org.omg.CORBA.NO_IMPLEMENT(
                "set_parameters is not implemented in ORBSingleton");
    }


    public org.omg.CORBA.portable.ValueFactory register_value_factory(String id, org.omg.CORBA.portable.ValueFactory factory) {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public void unregister_value_factory(String id) {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public org.omg.CORBA.portable.ValueFactory lookup_value_factory(String id) {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public void set_delegate(java.lang.Object wrapper) {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public boolean get_service_information(short service_type, org.omg.CORBA.ServiceInformationHolder service_information) {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public org.omg.CORBA.Policy create_policy(int policy_type, org.omg.CORBA.Any val) throws org.omg.CORBA.PolicyError {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }
    
    public NVList create_list(int count) {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public NVList create_operation_list(org.omg.CORBA.Object oper) {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public NamedValue create_named_value(String s, Any any, int flags) {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public ExceptionList create_exception_list() {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public ContextList create_context_list() {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public Context get_default_context() {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }
    
    public void send_multiple_requests_oneway(Request[] req) {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }

    public void send_multiple_requests_deferred(Request[] req) {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }
    
    public Request get_next_response() throws WrongTransaction {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }
    
    public Environment create_environment() {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }
    
    public boolean poll_next_response() {
        throw new org.omg.CORBA.NO_IMPLEMENT();
    }
    
    public org.omg.CORBA.Any create_any() {
        //implementation here
        return new org.huihoo.orbas.orb.types.Any(
                (org.omg.CORBA.ORB)(org.omg.CORBA.ORB.init()));
    }

    public TypeCode get_primitive_tc(TCKind tcKind) {
        //implementation here
        return TypeCodeFactory.getInstance().get_primitive_tc(tcKind);
    }

    public TypeCode create_struct_tc(String id, String name, StructMember[] members) {
        return TypeCodeFactory.getInstance().create_struct_tc(id, name, members);
    }

    public TypeCode create_union_tc(String id, String name, TypeCode discriminator_type, UnionMember[] members) {
        return TypeCodeFactory.getInstance().create_union_tc(id, name, discriminator_type, members);
    }

    public TypeCode create_enum_tc(String id, String name, String[] members) {
        return TypeCodeFactory.getInstance().create_enum_tc(id, name, members);
    }

    public TypeCode create_alias_tc(String id, String name, TypeCode original_type) {
        return TypeCodeFactory.getInstance().create_alias_tc(id, name, original_type);
    }

    public TypeCode create_exception_tc(String id, String name, StructMember[] members) {
        return TypeCodeFactory.getInstance().create_exception_tc(id, name, members);
    }

    public TypeCode create_interface_tc(String id, String name) {
        return TypeCodeFactory.getInstance().create_interface_tc(id, name);
    }

    public TypeCode create_string_tc(int bound) {
        return TypeCodeFactory.getInstance().create_string_tc(bound);
    }

    public TypeCode create_wstring_tc(int bound) {
        return TypeCodeFactory.getInstance().create_wstring_tc(bound);
    }

    public TypeCode create_fixed_tc(short digits, short scale) {
        return TypeCodeFactory.getInstance().create_fixed_tc(digits, scale);
    }

    public TypeCode create_sequence_tc(int bound, TypeCode element_type) {
        return TypeCodeFactory.getInstance().create_sequence_tc(bound, element_type);
    }

    /** @deprecated by CORBA 2.3 */
    public TypeCode create_recursive_sequence_tc(int bound, int offset) {
        return TypeCodeFactory.getInstance().create_recursive_sequence_tc(bound, offset);
    }

    public TypeCode create_array_tc(int length, TypeCode element_type) {
        return TypeCodeFactory.getInstance().create_array_tc(length, element_type);
    }

    public TypeCode create_value_tc(String id, String name, short type_modifier, TypeCode concrete_base,
        ValueMember[] members) {
            return TypeCodeFactory.getInstance().create_value_tc(id, name, type_modifier, concrete_base, members);
    }

    public TypeCode create_value_box_tc(String id, String name, TypeCode boxed_type) {
        return TypeCodeFactory.getInstance().create_value_box_tc(id, name, boxed_type);
    }

    public TypeCode create_native_tc(String id, String name) {
        return TypeCodeFactory.getInstance().create_native_tc(id, name);
    }

    public TypeCode create_recursive_tc(String id) {
        return TypeCodeFactory.getInstance().create_recursive_tc(id);
    }

    public TypeCode create_abstract_interface_tc(String id, String name) {
        return TypeCodeFactory.getInstance().create_abstract_interface_tc(id, name);
    }

    public TypeCode create_local_interface_tc(String id, String name) {
        return TypeCodeFactory.getInstance().create_local_interface_tc(id, name);
    }



}
